<!DOCTYPE html>
  <html>
  <head>
      <meta charset="utf-8">
      <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
      <title>个人中心</title>
      <link rel="stylesheet" type="text/css" href="../../css/api.css" />
      <link rel="stylesheet" type="text/css" href="../../css/common.css" />
      <link rel="stylesheet" type="text/css" href="../../css/aui.css" />
    	<link rel="stylesheet" type="text/css" href="../../css/aui-pull-refresh.css" />
      <style>
          html, body {width: 100%;min-height: 100%;background: #F3EFEE;}
          .aui-active .aui-bar-tab-label{
            color: #f5a51c
          }
          .login {height:240px;background-image: -webkit-linear-gradient(0deg, #f5c674, #ed824c);/*background-image: url(../../image/personal_bkg.jpg);background-repeat: no-repeat; background-size: cover;*/position: relative;}
      	.login .personal_logo {width: 4rem;height: 4rem;border-radius: 50%;margin: 0 auto 9px;/*position: absolute; top: 60px; left: 20px;*/}
      		.login .userinfo {position: absolute; top: 60px;text-align: center; left: 0; right: 0;}
      		.login .userinfo .title {font-size: 0.8rem; color: #fff;}

      		/* 设置条目 */
      		.item {height: 3rem;line-height: 3rem;padding-left: 0.7rem;background-color: #fff;}
      		.item_ico {float: left;width: 2.3rem;padding: 0.7rem 0.7rem 0.7rem 0;}
      		.item_arrow {float: right;width: 1.5rem;padding: 1rem 0.7rem 1rem 0;}
      		.item span {font-size: 0.7rem;}
          [v-cloak] {
              display: none;
          }
          .aui_list{
              background-image: linear-gradient(0,#eee,#eee 50%,transparent 50%);
          }
          .aui-list-item{
              background-image:linear-gradient(0,#eee,#eee 50%,transparent 50%) !important;
          }
          .refound_footer_img{
          	width:0.8rem;
          	height: 0.8rem;
          	margin-right: 0.5rem;
          	margin-top: -0.2rem
          }
          .aui-toast-content{
            color: #fff;
          }
      </style>
  </head>
  <body>
<div id="app" >
  <div class="aui-refresh-content">
  <header id="header_top" class="aui-bar aui-bar-nav">
    <a class="aui-pull-left" @click="goback()">
        <span class="aui-iconfont aui-icon-left" style="color:#333"></span>
    </a>
    <div class="aui-title changeTitle">退款详情</div>
  </header>
<div class="user_nav_line"></div>

    <ul class="aui-list aui-media-list">
      <li class="refoundAbout_content">
        <div class="refoundAbout_content_one">
          <div class="refoundAbout_content_text_one">退款等待处理</div>
          <div class="refoundAbout_content_text_two">{{orderListRefund.time}}</div>
        </div>

      </li>
      <li><div class="user_nav_line"></div></li>
      <li><div class="aui-card-list-header aui-font-size-14">退款信息</div></li>
      <li class=" aui-list-item-middle apply_main_li" style="background:#F7F7F7;" v-for="value in orderList.goods">

      <div class="aui-media-list-item-inner">
          <div class="aui-list-item-media" style="width: 4rem;">
              <img :src=value.goods_pic class="aui-list-img-md">
          </div>
          <div class="aui-list-item-inner">
                <div class="aui-list-item-text">
                    <div  class="aui-list-item-title" style="width: 100%;padding-right: 0.2rem;">
                      <div class="aui-font-size-12">{{value.goods_name}}</div>
                      <div class="aui-list-item-text aui-font-size-12" style="margin-top: 0.2rem;">{{value.sku_info}} <div  class="aui-list-item-right">×{{value.goods_nums}}</div></div>
                   </div>
                  </div>
              </div>
          </div>
       </li>
       <li class="aui-list-item aui-list-item-middle" style="padding-top:0.75rem;padding-bottom:0.75rem;">
           <div class="aui-media-list-item-inner refound_nav_height">
              <div class="aui-list-item-media aui-font-size-12" style="padding-right:0.5rem;width:3.5rem;padding-right:0;">退款原因:</div>
              <div class="aui-list-item-inner aui-font-size-12" style="padding-top: 0.6rem;">{{orderListRefund.return_reson}}</div>
           </div>
           <div class="aui-media-list-item-inner refound_nav_height">
              <div class="aui-list-item-media aui-font-size-12" style="padding-right:0.5rem;width:3.5rem;padding-right:0;">退款金额:</div>
              <div class="aui-list-item-inner aui-font-size-12" style="padding-top: 0.6rem;">￥{{orderListRefund.refund_money}}</div>
           </div>
           <div class="aui-media-list-item-inner refound_nav_height">
              <div class="aui-list-item-media aui-font-size-12" style="padding-right:0.5rem;width:3.5rem;padding-right:0;">申请时间:</div>
              <div class="aui-list-item-inner aui-font-size-12" style="padding-top: 0.6rem;">{{orderListRefund.addtime}}</div>
           </div>
           <div class="aui-media-list-item-inner refound_nav_height">
              <div class="aui-list-item-media aui-font-size-12" style="padding-right:0.5rem;width:3.5rem;padding-right:0;">退款编号:</div>
              <div class="aui-list-item-inner aui-font-size-12" style="padding-top: 0.6rem;">{{orderListRefund.return_no}}</div>
           </div>
       </li>
       <li>
         <div class="order_footer_pay" style="margin-right:0.75rem">
             <div class="order_footer_btn_one" style="margin-right:0.7rem" @click="orderClose()">拒绝退款</div>
             <div class="order_footer_btn_one" @click="refundStatus('1')">确认退款</div>

         </div>
       </li>
    </ul>
  </div>
  <div class="refround_footer_main">
    <div class="refound_footer_content">
      <img src="../../image/my/m36.png" alt="" class="refound_footer_img">
      <div class="refound_footer_text  aui-font-size-14">联系卖家</div>
    </div>
    <div class="refound_footer_content">
      <img src="../../image/my/m37.png" alt="" class="refound_footer_img">
      <div class="refound_footer_text  aui-font-size-14">拨打电话</div>
    </div>
    <div class="refound_footer_content">
      <img src="../../image/my/m35.png" alt="" class="refound_footer_img">
      <div class="refound_footer_text  aui-font-size-14">联系客服</div>
    </div>
  </div>

<!--弹框-->
</div>
  </body>
  <script type="text/javascript" src="../../script/api.js"></script>
  <script type="text/javascript" src="../../script/zepto.js"></script>
  <script type="text/javascript" src="../../script/vue.min.js"></script>
  <script type="text/javascript" src="../../script/utils.js"></script>
  <script type="text/javascript" src="../../script/common.js"></script>
  <script type="text/javascript" src="../../script/aui-tab.js"></script>
  <script type="text/javascript" src="../../script/aui-scroll.js"></script>
  <script type="text/javascript" src="../../script/aui-pull-refresh.js"></script>
  <script type="text/javascript" src="../../script/aui-popup.js"></script>
  <script type="text/javascript" src="../../script/aui-dialog.js"></script>
  <script type="text/javascript" src="../../script/aui-toast.js"></script>
  <script type="text/javascript">

      apiready = function(){
        var toast = new auiToast({});
        var dialog = new auiDialog({});
        new Vue({
          el:'#app',
          data:{
            orderListRefund:{},
            orderList:{},
            reason_id:''
          },
          methods:{
            orderClose: function (o_id){
              var $_this = this
              api.openFrame({
                  name: 'storeReasonWhy',
                  url: './storeReasonWhy.html',
                  bounces: false,
                  pageParam:{
                    o_id: api.pageParam.orderId,
                    type: 3
                  }
              });
            },


            //退款审核确认退款
            refundStatus:function(val){
               var values;
                dialog.alert({
                   title:"退款确认",
                   msg:'您已确定同意卖家的退款申请？',
                   buttons:['是的','再想想']
                 },function(ret){
                   if(ret.buttonIndex==1){
                     values={
                       token:$api.getStorage('token'),
                       orderId:api.pageParam.orderId,
                       type:val
                     }
                     api.ajax({
                         url: window.Url.Freestore_refundStatus,
                         method: 'post',
                         data: {
                             values:values
                         }
                     },function(ret, err){
                         if (ret.re==1) {
                              toast.success({
                                title:ret.info,
                                duration:1000
                              })
                         } else {
                           toast.fail({
                             title:ret.info,
                             duration:1000
                           })
                         }
                     });
                 }else if(ret.buttonIndex==2){
                     return;
                 }
               })
            },
            //退款详情
            refundDetail:function(){
              var _this = this;
              api.ajax({
                  url: window.Url.Freestore_refundDetail,
                  method: 'post',
                  data: {
                      values: {
                        token:$api.getStorage('token'),
                        orderId:api.pageParam.orderId
                      },
                  }
              },function(ret, err){
                  if (ret.re==1) {
                      _this.orderList = ret.data;
                      _this.orderListRefund = ret.data.refund;
                  } else {

                  }
              });

            },
            goback:function(){
              api.closeWin({});

            },
            //刷新
           setRefresh:function() {
                var pullRefresh = new auiPullToRefresh({
                    container: document.querySelector('.aui-refresh-content'),
                    triggerDistance: 100
                }, function(ret) {

                    if (ret.status == "success") {
                        setTimeout(function() {
                            pullRefresh.cancelLoading(); //刷新成功后调用此方法隐藏
                        }, 1500)
                    }
                })
            }

          },
          mounted:function(){
            this.setRefresh();
            this.refundDetail();

          }
        })
      };


  </script>
  </html>
